package com.bt.lms.ui.page.enp;

import com.bt.lms.ui.action.enp.*;
import com.bt.lms.main.BotLmsApp;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.*;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;

/**
 * 编辑招生计划界面
 */
public class EditEnrollmentPlan extends VBox {

    private Integer width= BotLmsApp.PER_WIGHT;

    private Integer height= BotLmsApp.HEIGHT;

    public EditEnrollmentPlan(){


        this.setPrefWidth(width);
        this.setPrefHeight(height);

        //当前位置
        HBox locationHBox = new HBox();
        locationHBox.setPadding(new Insets(15,15,15,15));
        locationHBox.setPrefWidth(width);
        double locationHBoxHeight=height*0.05;
        locationHBox.setPrefHeight(locationHBoxHeight);
        Label label1 = new Label("当前位置：🏠>招生管理>招生计划管理>编辑招生计划");
        Font font = Font.font("仿宋", FontWeight.THIN, FontPosture.REGULAR,18);
        label1.setFont(font);
        locationHBox.getChildren().add(label1);
        this.getChildren().add(locationHBox);



        //编辑招生计划标题
        HBox topHBox = new HBox();
        topHBox.setPadding(new Insets(15,15,15,15));
        double topHBoxHeight=height*0.05;
        topHBox.setPrefHeight(topHBoxHeight);
        topHBox.setPrefWidth(width);
        Label addLb = new Label("编辑招生计划");
        Font font1 = Font.font("仿宋", FontWeight.BOLD, FontPosture.REGULAR, 20);
        Color color = Color.rgb(150, 1, 1, 1);
        addLb.setFont(font1);
        addLb.setTextFill(color);

        topHBox.getChildren().add(addLb);
        this.getChildren().add(topHBox);

        //招生计划编号盒子
        HBox codeHBox = new HBox();
        codeHBox.setSpacing(60);
        codeHBox.setPadding(new Insets(15,15,15,15));
        double codeHBoxHeight=height*0.05;
        codeHBox.setPrefHeight(codeHBoxHeight);
        codeHBox.setPrefWidth(width);
        Label codeLb = new Label("招生计划编号");
        codeLb.setPrefWidth(100);
        Label codeDataLb = new Label("3487324274284");
        codeHBox.getChildren().addAll(codeLb,codeDataLb);

        //计划名称盒子
        HBox nameHBox = new HBox();
        nameHBox.setSpacing(60);
        nameHBox.setPadding(new Insets(15,15,15,15));
        double nameHBoxHeight=height*0.05;
        nameHBox.setPrefHeight(nameHBoxHeight);
        nameHBox.setPrefWidth(width);
        Label nameLb = new Label("计划名称");
        nameLb.setPrefWidth(100);
        Label nameDataTf = new Label("网联培训计划");
        nameHBox.getChildren().addAll(nameLb,nameDataTf);

        //计划内容盒子
        HBox contentHBox = new HBox();
        contentHBox.setSpacing(60);
        contentHBox.setPadding(new Insets(15,15,15,15));
        double contentHBoxHeight=height*0.1;
        contentHBox.setPrefHeight(contentHBoxHeight);
        contentHBox.setPrefWidth(width);
        Label contentLb = new Label("计划内容");
        contentLb.setPrefWidth(100);
        Label contentDataLb = new Label("为了更好的开展全国教师的培训，安博教育集团\n" +
                " 为了更好的开展全国教师的培训，\n" +
                "安博教育集团 为了更好的开展全国教师的培训\n" +
                "，安博教育集团 为了更好的开展全国教师的培训，\n");
        contentDataLb.setMinHeight(70);
        contentHBox.getChildren().addAll(contentLb,contentDataLb);




        //招生层次盒子
        HBox levelHBox = new HBox();
        levelHBox.setSpacing(60);
        levelHBox.setPadding(new Insets(15,15,15,15));
        double levelHBoxHeight=height*0.05;
        levelHBox.setPrefHeight(levelHBoxHeight);
        levelHBox.setPrefWidth(width);
        Label levelLb = new Label("招生层次");
        levelLb.setPrefWidth(100);
        Label levelDataLb = new Label("免费师范生");
        levelHBox.getChildren().addAll(levelLb,levelDataLb);

        //招生专业盒子
        HBox specialtyHBox = new HBox();
        specialtyHBox.setSpacing(60);
        specialtyHBox.setPadding(new Insets(15,15,15,15));
        double specialtyHBoxHeight=height*0.05;
        specialtyHBox.setPrefHeight(specialtyHBoxHeight);
        specialtyHBox.setPrefWidth(width);
        Label specialtyLb = new Label("招生专业");
        specialtyLb.setPrefWidth(100);
        Label specialtyDataLb = new Label("学科教育");
        specialtyHBox.getChildren().addAll(specialtyLb,specialtyDataLb);


        //招生人数盒子
        HBox enPopulationHBox = new HBox();
        enPopulationHBox.setSpacing(60);
        enPopulationHBox.setPadding(new Insets(15,15,15,15));
        double enPopulationHBoxHeight=height*0.05;
        enPopulationHBox.setPrefHeight(enPopulationHBoxHeight);
        enPopulationHBox.setPrefWidth(width);
        Label enPopulationLb = new Label("招生人数");
        enPopulationLb.setPrefWidth(100);
        Label enPopulationDataLb = new Label("657人");
        enPopulationHBox.getChildren().addAll(enPopulationLb,enPopulationDataLb);

        //关联教学计划盒子
        HBox associationItemsHBox = new HBox();
        associationItemsHBox.setSpacing(60);
        associationItemsHBox.setPadding(new Insets(15,15,15,15));
        double associationItemsHBoxHeight=height*0.05;
        associationItemsHBox.setPrefHeight(associationItemsHBoxHeight);
        associationItemsHBox.setPrefWidth(width);
        Label associationItemsLb = new Label("关联教学计划");
        Label label = new Label();
        associationItemsLb.setPrefWidth(100);
        associationItemsHBox.getChildren().addAll(associationItemsLb,label);

        //学习年限盒子
        HBox studyYearHBox = new HBox();
        studyYearHBox.setSpacing(60);
        studyYearHBox.setPadding(new Insets(15,15,15,15));
        double studyYearHBoxHeight=height*0.05;
        studyYearHBox.setPrefHeight(studyYearHBoxHeight);
        studyYearHBox.setPrefWidth(width);
        Label studyYearLb = new Label("学习年限");
        studyYearLb.setPrefWidth(100);
        Label studyYearDataLb = new Label("24个月");
        studyYearHBox.getChildren().addAll(studyYearLb,studyYearDataLb);

        //学习学费盒子
        HBox tuitionHBox = new HBox();
        tuitionHBox.setSpacing(60);
        tuitionHBox.setPadding(new Insets(15,15,15,15));
        double tuitionHBoxHeight=height*0.05;
        tuitionHBox.setPrefHeight(tuitionHBoxHeight);
        tuitionHBox.setPrefWidth(width);
        Label tuitionLb = new Label("学习学费");
        tuitionLb.setPrefWidth(100);
        Label tuitionDataLb = new Label("3468元");
        tuitionHBox.getChildren().addAll(tuitionLb,tuitionDataLb);

        //报名起止时间盒子
        HBox timeHBox = new HBox();
        timeHBox.setSpacing(60);
        timeHBox.setPadding(new Insets(15,15,15,15));
        double timeHBoxHeight=height*0.05;
        timeHBox.setPrefHeight(timeHBoxHeight);
        timeHBox.setPrefWidth(width);
        Label timeLb = new Label("报名起止时间");
        timeLb.setPrefWidth(100);
        Label timeDataLb = new Label("2011-09-12 至2012-09-11");
        timeHBox.getChildren().addAll(timeLb,timeDataLb);

        //报名方式
        HBox regModeHBox = new HBox();
        regModeHBox.setSpacing(60);
        regModeHBox.setPadding(new Insets(15,15,15,15));
        double regModeHBoxHeight=height*0.05;
        regModeHBox.setPrefHeight(regModeHBoxHeight);
        regModeHBox.setPrefWidth(width);
        Label regModeLab = new Label("报名方式");
        regModeLab.setPrefWidth(100);
        Label ModeLab = new Label("线上");
        regModeHBox.getChildren().addAll(regModeLab,ModeLab);




        //报名地点盒子
        HBox enrollmentLocationHBox = new HBox();
        enrollmentLocationHBox.setSpacing(60);
        enrollmentLocationHBox.setPadding(new Insets(15,15,15,15));
        double enrollmentLocationHBoxHeight=height*0.05;
        enrollmentLocationHBox.setPrefHeight(enrollmentLocationHBoxHeight);
        enrollmentLocationHBox.setPrefWidth(width);
        Label enrollmentLocationLb = new Label("报名地点");
        enrollmentLocationLb.setPrefWidth(100);
        Label enrollmentLocationDataLb = new Label("北京市朝阳区对外经贸大学");
        enrollmentLocationHBox.getChildren().addAll(enrollmentLocationLb,enrollmentLocationDataLb);

        //联系人盒子
        HBox LtdContactHBox = new HBox();
        LtdContactHBox.setSpacing(60);
        LtdContactHBox.setPadding(new Insets(15,15,15,15));
        double LtdContactHBoxHeight=height*0.05;
        LtdContactHBox.setPrefHeight(LtdContactHBoxHeight);
        LtdContactHBox.setPrefWidth(width);
        Label LtdContactLb = new Label("联系人");
        LtdContactLb.setPrefWidth(100);
        Label LtdContactDataLb = new Label("李舒淇");
        LtdContactHBox.getChildren().addAll(LtdContactLb,LtdContactDataLb);

        //电话盒子
        HBox phoneHBox = new HBox();
        phoneHBox.setSpacing(60);
        phoneHBox.setPadding(new Insets(15,15,15,15));
        double phoneHBoxHeight=height*0.05;
        phoneHBox.setPrefHeight(phoneHBoxHeight);
        phoneHBox.setPrefWidth(width);
        Label phoneLb = new Label("电话");
        phoneLb.setPrefWidth(100);
        Label phoneDataLb = new Label("13503593935");
        phoneHBox.getChildren().addAll(phoneLb,phoneDataLb);

        //电子邮箱
        HBox emailHBox = new HBox();
        emailHBox.setSpacing(60);
        emailHBox.setPadding(new Insets(15,15,15,15));
        double emailHBoxHeight=height*0.05;
        emailHBox.setPrefHeight(emailHBoxHeight);
        emailHBox.setPrefWidth(width);
        Label emailLb = new Label("电子邮箱");
        emailLb.setPrefWidth(100);
        Label emailDataLb = new Label("zhongzheng_009@q63.com");
        emailHBox.getChildren().addAll(emailLb,emailDataLb);

        //报名材料盒子
        HBox materialsHBox = new HBox();
        materialsHBox.setSpacing(60);
        materialsHBox.setPadding(new Insets(15,15,15,15));
        double materialsHBoxHeight=height*0.05;
        materialsHBox.setPrefHeight(materialsHBoxHeight);
        materialsHBox.setPrefWidth(width);
        Label materialsLb = new Label("报名材料");
        materialsLb.setPrefWidth(100);
        Label materialsDataLb = new Label("身份证、照片、学历证书、学位证书、体检报告、其他");
        materialsHBox.getChildren().addAll(materialsLb,materialsDataLb);

        //报名事项盒子
        HBox itemsHBox = new HBox();
        itemsHBox.setSpacing(60);
        itemsHBox.setPadding(new Insets(15,15,15,15));
        double itemsHBoxHeight=height*0.1;
        itemsHBox.setPrefHeight(itemsHBoxHeight);
        itemsHBox.setPrefWidth(width);
        Label itemsLb = new Label("报名事项");
        itemsLb.setPrefWidth(100);
        Label itemsDataLb = new Label("入学考试相关内容介绍");
        itemsHBox.getChildren().addAll(itemsLb,itemsDataLb);

        //毕/结业相关事项盒子
        HBox graduateHBox = new HBox();
        graduateHBox.setSpacing(60);
        graduateHBox.setPadding(new Insets(15,15,15,15));
        double graduateHBoxHeight=height*0.1;
        graduateHBox.setPrefHeight(graduateHBoxHeight);
        graduateHBox.setPrefWidth(width);
        Label graduateLb = new Label("毕/结业相关事项");
        graduateLb.setPrefWidth(100);
        Label graduateDataLb = new Label("事发时发生");
        graduateHBox.getChildren().addAll(graduateLb,graduateDataLb);

        //补充说明盒子
        HBox replenishHBox = new HBox();
        replenishHBox.setSpacing(60);
        replenishHBox.setPadding(new Insets(15,15,15,15));
        double replenishHBoxHeight=height*0.1;
        replenishHBox.setPrefHeight(replenishHBoxHeight);
        replenishHBox.setPrefWidth(width);
        Label replenishLb = new Label("补充说明");
        replenishLb.setPrefWidth(100);
        Label replenishDataLb = new Label("而对佛哇卡死不i神佛侧边粗");
        replenishHBox.getChildren().addAll(replenishLb,replenishDataLb);

        //编辑按钮盒子
        HBox editBtnHBox = new HBox();
        editBtnHBox.setAlignment(Pos.CENTER_RIGHT);
        editBtnHBox.setPadding(new Insets(15,30,0,0));
        double editBtnHBoxHeight=height*0.05;
        editBtnHBox.setPrefHeight(editBtnHBoxHeight);
        editBtnHBox.setPrefWidth(width);
        Button editBtn = new Button("编辑");
        editBtnHBox.getChildren().add(editBtn);







        //左盒子
        VBox leftVBox = new VBox();
        double leftVBoxHeight=height*0.5;
        leftVBox.setPrefHeight(leftVBoxHeight);
        leftVBox.setPrefWidth(width*0.5);
        leftVBox.getChildren().addAll(codeHBox,nameHBox,contentHBox,levelHBox,specialtyHBox,enPopulationHBox,associationItemsHBox,studyYearHBox,tuitionHBox);

        //右盒子
        VBox rightVBox = new VBox();
        double rightVBoxHeight=height*0.5;
        rightVBox.setPrefHeight(rightVBoxHeight);
        rightVBox.setPrefWidth(width*0.5);
        rightVBox.getChildren().addAll(timeHBox,regModeHBox,enrollmentLocationHBox,LtdContactHBox,phoneHBox,emailHBox,materialsHBox,itemsHBox,graduateHBox,replenishHBox);

        //横向盒子
        HBox totalHBox = new HBox();
        totalHBox.setPadding(new Insets(15,15,15,15));
        double totalHBoxHeight=height*0.5;
        totalHBox.setPrefHeight(totalHBoxHeight);
        totalHBox.setPrefWidth(width);
        totalHBox.getChildren().addAll(leftVBox,rightVBox);



        //详情大盒子
        VBox detailsVBox = new VBox();
        detailsVBox.setPadding(new Insets(15,15,15,15));
        double totalVBoxHeight=height*0.95;
        detailsVBox.setPrefHeight(totalVBoxHeight);
        detailsVBox.setPrefWidth(width);
        ScrollPane scrollPane = new ScrollPane();//滚动条
        scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
        scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS);//只能竖向滚动不能横向滚动
        scrollPane.setContent(detailsVBox);
        detailsVBox.getChildren().addAll(editBtnHBox,totalHBox);
        this.getChildren().add(scrollPane);

        //编辑事件
        EditEnpPlanAction editEnpPlanAction = new EditEnpPlanAction(detailsVBox);
        editBtn.setOnAction(editEnpPlanAction);












    }

}
